package com.dgut.lotterySystem.service.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum ActivityEnum {
    RUNNING(1,"活动进行中"),
    COMPLETED(2,"活动已结束");
    /**
     * 状态码
     */
    private Integer code;
    /**
     * 状态信息
     */
    private String message;
    public static ActivityEnum forName(String name){
        for (ActivityEnum activityEnum:ActivityEnum.values()) {
            if(activityEnum.name().equalsIgnoreCase(name)) return activityEnum;//通过比较字母是否相同，返回对象
        }
        return null;
    }
}
